<?php
class Socialprofiles_Model_Updatesocialprofiles implements Socialprofiles_Model_Mainable {
    
    private $core_controller_notnull;
    private $core_controller_tokencheckout;
    
    private $socialprofiles_data_updatesocialprofiles;
    
    private $excepted_result = 1;
    private $actual_result;
    
    public function main(array $variables = null) {
        $this->core_controller_notnull = new Core_Controller_Notnull;
        $this->core_controller_tokencheckout = new Core_Controller_Tokencheckout;
        $this->core_controller_notnull->main($variables);
        $this->core_controller_tokencheckout->main($variables['post']);
        
        $this->socialprofiles_data_updatesocialprofiles = new Socialprofiles_Data_Updatesocialprofiles;
        $this->actual_result = $this->socialprofiles_data_updatesocialprofiles->main($variables);
        if(
                $this->actual_result == $this->excepted_result
                ){
            header("Location: ".SITE_ROOT."ustawienia-spolecznosciowe.html");
        }
        else {
            header("Location: ".SITE_ROOT."ustawienia-spolecznosciowe.html");
        }
    }

}
